.class public final Llt/farmis/libraries/shape_import_android/readers/KmlFileReader;
.super Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;
.source "KmlFileReader.kt"


# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
    value = "SMAP\nKmlFileReader.kt\nKotlin\n*S Kotlin\n*F\n+ 1 KmlFileReader.kt\nlt/farmis/libraries/shape_import_android/readers/KmlFileReader\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,53:1\n1752#2,5:54\n1479#2:59\n1479#2,2:60\n1480#2:62\n*E\n*S KotlinDebug\n*F\n+ 1 KmlFileReader.kt\nlt/farmis/libraries/shape_import_android/readers/KmlFileReader\n*L\n14#1,5:54\n16#1:59\n16#1,2:60\n16#1:62\n*E\n"
.end annotation


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 10
    invoke-direct {p0}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;-><init>()V

    return-void
.end method

.method private final getDataSet(Ljava/lang/String;)Llt/farmis/libraries/shape_import_android/kml/DataSet;
    .locals 4

    .line 28
    :try_start_0
    invoke-static {}, Ljavax/xml/parsers/SAXParserFactory;->newInstance()Ljavax/xml/parsers/SAXParserFactory;

    move-result-object v0

    .line 29
    invoke-virtual {v0}, Ljavax/xml/parsers/SAXParserFactory;->newSAXParser()Ljavax/xml/parsers/SAXParser;

    move-result-object v0

    .line 32
    invoke-virtual {v0}, Ljavax/xml/parsers/SAXParser;->getXMLReader()Lorg/xml/sax/XMLReader;

    move-result-object v0

    .line 35
    new-instance v1, Llt/farmis/libraries/shape_import_android/kml/SaxHandler;

    invoke-direct {v1}, Llt/farmis/libraries/shape_import_android/kml/SaxHandler;-><init>()V

    .line 36
    invoke-interface {v0, v1}, Lorg/xml/sax/XMLReader;->setContentHandler(Lorg/xml/sax/ContentHandler;)V

    .line 39
    new-instance v2, Lorg/xml/sax/InputSource;

    new-instance v3, Ljava/io/StringReader;

    invoke-direct {v3, p1}, Ljava/io/StringReader;-><init>(Ljava/lang/String;)V

    invoke-direct {v2, v3}, Lorg/xml/sax/InputSource;-><init>(Ljava/io/Reader;)V

    invoke-interface {v0, v2}, Lorg/xml/sax/XMLReader;->parse(Lorg/xml/sax/InputSource;)V

    .line 42
    invoke-virtual {v1}, Llt/farmis/libraries/shape_import_android/kml/SaxHandler;->getParsedData()Llt/farmis/libraries/shape_import_android/kml/DataSet;

    move-result-object p1

    const-string v0, "dataSet"

    .line 44
    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object p1

    :catch_0
    move-exception p1

    .line 47
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    .line 50
    new-instance p1, Llt/farmis/libraries/shape_import_android/kml/DataSet;

    invoke-direct {p1}, Llt/farmis/libraries/shape_import_android/kml/DataSet;-><init>()V

    return-object p1
.end method


# virtual methods
.method public read(Ljava/lang/String;)Z
    .locals 3

    const-string v0, "fileText"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 13
    invoke-direct {p0, p1}, Llt/farmis/libraries/shape_import_android/readers/KmlFileReader;->getDataSet(Ljava/lang/String;)Llt/farmis/libraries/shape_import_android/kml/DataSet;

    move-result-object p1

    .line 14
    invoke-virtual {p1}, Llt/farmis/libraries/shape_import_android/kml/DataSet;->getPlacemarks()Ljava/util/ArrayList;

    move-result-object v0

    .line 55
    invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v0

    const/4 v1, 0x0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    .line 56
    check-cast v2, Llt/farmis/libraries/shape_import_android/kml/Placemark;

    .line 14
    invoke-virtual {v2}, Llt/farmis/libraries/shape_import_android/kml/Placemark;->getShapeList()Ljava/util/List;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    add-int/2addr v1, v2

    goto :goto_0

    .line 58
    :cond_0
    invoke-virtual {p0, v1}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->setTotalMeasurementCount(I)V

    .line 16
    invoke-virtual {p1}, Llt/farmis/libraries/shape_import_android/kml/DataSet;->getPlacemarks()Ljava/util/ArrayList;

    move-result-object p1

    .line 59
    invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :cond_1
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Llt/farmis/libraries/shape_import_android/kml/Placemark;

    .line 17
    invoke-virtual {v0}, Llt/farmis/libraries/shape_import_android/kml/Placemark;->getShapeModelList()Ljava/util/List;

    move-result-object v0

    .line 60
    invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Llt/farmis/libraries/shape_import_android/models/ShapeModel;

    .line 18
    invoke-virtual {p0}, Llt/farmis/libraries/shape_import_android/readers/AbsFileReader;->getMeasurementModels()Ljava/util/List;

    move-result-object v2

    invoke-interface {v2, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1

    :cond_2
    const/4 p1, 0x1

    return p1
.end method
